#include <cstdio>

bool visit[ 1000001 ], ok[ 1000001 ];
int f[ 1000001 ];

void init( )
{
    int i, j, t;
    for ( i = 2; i <= 1000000; i++ )
        if ( !visit[ i ] )
            for ( j = i * 2; j <= 1000000; j += i )
                visit[ j ] = 1;
    visit[ 0 ] = visit[ 1 ] = 0;
    i = 7; t = 12;
    while ( i <= 1000000 )
    {
        ok[ i ] = true;
        i += t;
        t += 6;
    }
    for ( i = 1; i <= 1000000; i++ )
        f[ i ] = f[ i - 1 ] + ( ok[ i ] && !visit[ i ] );
}

int main( )
{
    int n;
    init( );
    while ( scanf("%d", &n) != EOF )
        if ( f[ n ] == 0 )
            puts("No Special Prime!");
        else
            printf("%d\n", f[ n ]);
    return 0;
}
